<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'success.jsp' starting page</title>
    
<link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
	<link rel="stylesheet" href="<%=basePath%>common/plugins/code/prettify.css" />
	<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
	<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
	<script charset="utf-8" src="<%=basePath%>common/plugins/code/prettify.js"></script>
  </head>
  
  <body>
  <!--<input id="isid"  type="text" value="1" />
   				 标签 
			    <div class="box box-primary">
              	<form id="dateTimeForm">
                <div class="box-header">
                  <h3 class="box-title" style="width:100%;line-height:28px;">标签<i id="savetags" style="float:right;font-style: normal;" class="btn btn-success">保存</i></h3>
                </div>
                <div class="box-body">

                  <div class="">
                    <div class="form-group">
                      <label>标签:</label>
               
						<div class="example example_markup">
          
          					<div class="bs-example">
            					<input id="tagssave"  type="text" value="${requestScope.position.tags}" data-role="tagsinput" />
          					</div>
     				 	</div>
                    </div> /.form group 
                  </div>
                  
                  
                </div> /.box-body 
                </form>
              </div> /.box -->
              <!-- 标签 -->
            <%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>
<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '<%=basePath%>common/plugins/code/prettify.css',
				uploadJson : '../upload_json.jsp',
				fileManagerJson : '../file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
		
$("#savetags").click(function(){

$.ajax({
		url:"<%=basePath%>admin/updatetags?tags="+$("#tagssave").val()+"&id="+$("#isid").val(),
		success:function(data){
			$("#messageModal").modal();
    		$("#messagespan").html(data.message);
		}
	});
});
		
	</script>
  </body>
</html>
